home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Belgian Amiga Club - ADF Collection
/
BS1 part 05.zip
/
BS1 part 5
/
World_Atlas_1.adf
/
REXX
/
Tutor.wa
< prev
Wrap
Text File
|
1991-09-25
|
4KB
|
176 lines
/*
World Atlas V2.50b - AREXX Script (tutor example)
Written By Henrik Brinch
This is ONLY a very simple (but not less useable) example
of how you can use "World Atlas" as a tutor.
You could make a more powerfull program, with ie. maps, and
all the countries of the world.
*/
address 'atlas'
options results
numquestions = 0
wb2front
say
say " *************************************************************"
say " * *"
say ' * Welcome to the "World Of Questions" *'
say " * *"
say " * Simple example of how you can use World Atlas *"
say " * as a tutor in geography *"
say " * *"
say " * AREXX script written by Henrik Brinch *"
say " * *"
say " *************************************************************"
say
say " Please highlight this window by clicking inside of it!"
say
say
/* This line is neccesarry as we might be on the map for Europe
and we load in information about USA (Changing the data).
Then when we click on a country, we might get the name of the
state
*/
suspend
do while numquestions < 1
say
say " How many questions do you want ?"
pull numquestions
end
oks = 1
good = 0
rgood = 0
do i=1 to numquestions
makeseed
con = random(1,50,result)
num2con 1 con
state = result
capital 1 con
cap = upper(result)
answer = ""
done = 0
do while done == 0
say
say "Question number "i" out of "numquestions" - (try number "oks")"
say "------------------------------------------------------------"
say "What is the capital of "state" ?"
pull answer
if answer ~= cap then do
say
say " @!$#@$ WRONG %$#@!#"
oks = oks+1
if oks = 4 then do
say
if i ~= numquestions then say "You really don't remember?"
say "The capital of "state" is "cap" (better luck next time!)"
say
done = 2
oks = 1
end
end
if done = 0 then do
if answer == cap then done = 1
end
end
if done == 1 then do
say
say " -= CORRECT -="
if oks == 1 then do
rgood = rgood+1
good = good+1
end
if oks ~= 1 then good = good+1
end
end
say
say "You only wanted "numquestions" questions, so we're finished"
say
say "============================================================"
say "Here are some statistics about your answers :"
say "============================================================"
if good == 0 then do
say "SHAME ON YOU!!!"
say
say "You didn't answer ANY question right..."
say "May I suggest some training?!"
say
end
if good > 0 then do
say "You answered "good" out of "numquestions" questions right!"
say "You answered "rgood" questions right at first try"
calc = (good/numquestions)*100
say "Percent of questions answered "calc"%"
say
say " RATING :"
say
if calc < 5 then do
say " Not very nice! Keep training!"
say
call bye
end
if calc < 10 then do
say " Hmmm please don't brag!"
say
call bye
end
if calc < 20 then do
say " Now we're getting somewhere eh'?"
say
call bye
end
if calc < 40 then do
say " If you can do "calc"% you can also do 60%!"
say
call bye
end
if calc < 60 then do
say " Do you know you only needed "100-calc"% before you had"
say " answered all question... next time do 100% right?"
say
call bye
end
if calc < 80 then do
say " Keep going, and you just might be get to be a pro?"
say
call bye
end
if calc == 100 then do
say " I'm amazed you're really a pro' !!!"
say
call bye
end
end
/* Remember to release the suspended World Atlas... clever thing to do!
These two lines should be in any program, that might change
the data version!
*/
bye:
release
select_menu
delay 50*5 /* Make a delay for 5 sec. so we can see the result */
wa2front
exit